package com.ruoyi.net.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.domain.DeviceStatusAprNeighb;
import com.ruoyi.net.mapper.DeviceStatusAprNeighbMapper;
import com.ruoyi.net.service.IDeviceStatusAprNeighbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 设备状态-APR邻居Service业务层处理
 * 
 * @author tony
 * @date 2024-12-11
 */
@Service
public class DeviceStatusAprNeighbServiceImpl implements IDeviceStatusAprNeighbService 
{
    @Autowired
    private DeviceStatusAprNeighbMapper deviceStatusAprNeighbMapper;

    /**
     * 查询设备状态-APR邻居
     * 
     * @param id 设备状态-APR邻居主键
     * @return 设备状态-APR邻居
     */
    @Override
    public DeviceStatusAprNeighb selectDeviceStatusAprNeighbById(Long id)
    {
        return deviceStatusAprNeighbMapper.selectDeviceStatusAprNeighbById(id);
    }

    /**
     * 查询设备状态-APR邻居列表
     * 
     * @param deviceStatusAprNeighb 设备状态-APR邻居
     * @return 设备状态-APR邻居
     */
    @Override
    public List<DeviceStatusAprNeighb> selectDeviceStatusAprNeighbList(DeviceStatusAprNeighb deviceStatusAprNeighb)
    {
        return deviceStatusAprNeighbMapper.selectDeviceStatusAprNeighbList(deviceStatusAprNeighb);
    }

    /**
     * 新增设备状态-APR邻居
     * 
     * @param deviceStatusAprNeighb 设备状态-APR邻居
     * @return 结果
     */
    @Override
    public int insertDeviceStatusAprNeighb(DeviceStatusAprNeighb deviceStatusAprNeighb)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(deviceStatusAprNeighb.getId())) {
            deviceStatusAprNeighb.setId(uuid);
        }
        deviceStatusAprNeighb.setCreateBy(SecurityUtils.getUsername());
        deviceStatusAprNeighb.setCreateTime(DateUtils.getNowDate());
        deviceStatusAprNeighb.setUpdateBy(SecurityUtils.getUsername());
        deviceStatusAprNeighb.setUpdateTime(DateUtils.getNowDate());
        return deviceStatusAprNeighbMapper.insertDeviceStatusAprNeighb(deviceStatusAprNeighb);
    }

    /**
     * 修改设备状态-APR邻居
     * 
     * @param deviceStatusAprNeighb 设备状态-APR邻居
     * @return 结果
     */
    @Override
    public int updateDeviceStatusAprNeighb(DeviceStatusAprNeighb deviceStatusAprNeighb)
    {
        deviceStatusAprNeighb.setUpdateBy(SecurityUtils.getUsername());
        deviceStatusAprNeighb.setUpdateTime(DateUtils.getNowDate());
        return deviceStatusAprNeighbMapper.updateDeviceStatusAprNeighb(deviceStatusAprNeighb);
    }

    /**
     * 批量删除设备状态-APR邻居
     * 
     * @param ids 需要删除的设备状态-APR邻居主键
     * @return 结果
     */
    @Override
    public int deleteDeviceStatusAprNeighbByIds(Long[] ids)
    {
        return deviceStatusAprNeighbMapper.deleteDeviceStatusAprNeighbByIds(ids);
    }

    /**
     * 删除设备状态-APR邻居信息
     * 
     * @param id 设备状态-APR邻居主键
     * @return 结果
     */
    @Override
    public int deleteDeviceStatusAprNeighbById(Long id)
    {
        return deviceStatusAprNeighbMapper.deleteDeviceStatusAprNeighbById(id);
    }
}
